import { request } from '@/utils/request';
// import type { BaseResponse } from '@/utils/request';
import Api from '@/core/permission/modules/sup/create-task';
import publicApi from '@/core/permission/modules/public/params';

/**
 * @description 添加任务信息
 * @param {API.SaveTaskQuery} data
 * @returns
 */
export function saveTask(data: API.SaveTaskQuery) {
  return request(
    {
      url: Api.save,
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 编辑任务信息
 * @param {API.SaveTaskQuery} data
 * @returns
 */
export function updataTask(data: API.SaveTaskQuery) {
  return request(
    {
      url: Api.updata,
      method: 'put',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 任务信息详情
 * @returns
 */
export function taskxfInfo(id: any) {
  return request({
    url: Api.info + `/${id}`,
    method: 'get',
  });
}

/**
 * @description 获取检查类型字典
 * @returns
 */
export function getCheckType() {
  return request(
    {
      url: publicApi.check_type,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 获取身份证件类型字典
 * @returns
 */
export function getIdType() {
  return request(
    {
      url: publicApi.id_type,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 获取区域数据
 * @returns
 */
export function getAreaList() {
  return request(
    {
      url: publicApi.area,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}
